﻿using monitoring_system.Share;
using Prism.Regions;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace monitoring_system.ViewModels
{
    public class LoginViewModel
    {
        [Reactive]
        public double Value1 {  get; set; }
        public IRegionManager RegionManager { get;}
        public ICommand LoginCommand { get; }
        /// <summary>
        /// ReactiveCommand：使用reactiveUI框架
        /// </summary>
        public LoginViewModel(IRegionManager regionManager)
        {
            RegionManager = regionManager;
            LoginCommand = ReactiveCommand.Create(OnLoginCommand);
            
        }

        private void OnLoginCommand()
        {
            RegionManager.RequestNavigate(RegionNames.MainRegion, ViewNames.MainView);
        }
    }
}
